// BGModel.h: interface for the BGModel class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BGMODEL_H__EC778154_E819_49EA_B3E4_2B306F2939A8__INCLUDED_)
#define AFX_BGMODEL_H__EC778154_E819_49EA_B3E4_2B306F2939A8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include "PixelProcess.h"


class BGModel  
{
public:
	BGModel(int vw, int vh);
	virtual ~BGModel();

   bool Process(IplImage *pFrame, IplImage *pFgMask);
   bool ProcessGradient(const double Tg, IplImage *pFgMask);
   int mx;
   int my;
protected:
	double GetGradientDistribution(int x, int y, PixelProcess *p, PixelProcess *pRight, PixelProcess *pDown);

   PixelProcess *pixels;
   int vw, vh;
   int nPixels;

};

#endif // !defined(AFX_BGMODEL_H__EC778154_E819_49EA_B3E4_2B306F2939A8__INCLUDED_)
